package com.ruoyi.novel.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.novel.mapper.BrokerageMapper;
import com.ruoyi.novel.domain.Brokerage;
import com.ruoyi.novel.service.IBrokerageService;

/**
 * 佣金记录Service业务层处理
 *
 * @author 张三
 * @date 2025-06-11
 */
@Service
public class BrokerageServiceImpl extends ServiceImpl<BrokerageMapper, Brokerage> implements IBrokerageService
{
    @Autowired
    private BrokerageMapper brokerageMapper;

    /**
     * 查询佣金记录
     *
     * @param id 佣金记录主键
     * @return 佣金记录
     */
    @Override
    public Brokerage selectBrokerageById(Integer id)
    {
        return brokerageMapper.selectBrokerageById(id);
    }

    /**
     * 查询佣金记录列表
     *
     * @param brokerage 佣金记录
     * @return 佣金记录
     */
    @Override
    public List<Brokerage> selectBrokerageList(Brokerage brokerage)
    {
        return brokerageMapper.selectBrokerageList(brokerage);
    }

    /**
     * 新增佣金记录
     *
     * @param brokerage 佣金记录
     * @return 结果
     */
    @Override
    public int insertBrokerage(Brokerage brokerage)
    {
        brokerage.setCreateTime(DateUtils.getNowDate());
        return brokerageMapper.insertBrokerage(brokerage);
    }

    /**
     * 修改佣金记录
     *
     * @param brokerage 佣金记录
     * @return 结果
     */
    @Override
    public int updateBrokerage(Brokerage brokerage)
    {
        brokerage.setUpdateTime(DateUtils.getNowDate());
        return brokerageMapper.updateBrokerage(brokerage);
    }

    /**
     * 批量删除佣金记录
     *
     * @param ids 需要删除的佣金记录主键
     * @return 结果
     */
    @Override
    public int deleteBrokerageByIds(Integer[] ids)
    {
        return brokerageMapper.deleteBrokerageByIds(ids);
    }

    /**
     * 删除佣金记录信息
     *
     * @param id 佣金记录主键
     * @return 结果
     */
    @Override
    public int deleteBrokerageById(Integer id)
    {
        return brokerageMapper.deleteBrokerageById(id);
    }
}
